package com.kun.alldb.support.adaptor;

import com.kun.alldb.base.DatasourceBase;
import com.kun.db.ds.simple.SimpleDataSource;

import javax.sql.DataSource;

/**
 * 数据源实例适配器
 * @author kun.li
 */
public class DataSourceAdaptor {


    public static DataSource getDataSource(DatasourceBase datasourceBase) {
        return new SimpleDataSource(
                datasourceBase.getDriverUrl(),
                datasourceBase.getUsername(),
                datasourceBase.getPassword(),
                datasourceBase.getDriverClassName(),
                datasourceBase.getDriverJarPath()
        );
    }

}
